package com.interview.item.javabase.arrays;


import java.util.ArrayList;
import java.util.List;

/**
 * @Author:zxh
 * @Description:
 * @Date: 2020/5/14
 * @Modified By:
 */
public class ComparyArrays {

    public void sorryList(List<User> userList) {
        /*Collections.sort(userList, new Comparator<User>() {
            @Override
            public int compare(User o1, User o2) {
                return o2.getPriority().compareTo(o1.getPriority());
            }
        });*/
    }

    public static void main(String[] args) {
        List<User> userList = new ArrayList<>();
        User user = new User();
        user.setPriority("1");
        userList.add(user);

        User user3 = new User();
        user3.setPriority("41");
        userList.add(user3);

        User user4 = new User();
        user4.setPriority("300");
        userList.add(user4);

        ComparyArrays comparyArrays = new ComparyArrays();
        comparyArrays.sorryList(userList);
        System.out.println(userList.toString());
    }


}
